[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
    Procedure StringToDate(Strg:String;Var Date:TimeDate;
                           Const Style:Byte; Var Code:Integer);

    Strg  contains  the  input   string.    Style   specifies  the  style
    of the input string  so  the  string  can  be  decoded.   Date is the
    output date.  Date.Hour, Date.Min,  Date.Sec,  Date.ms,  Date.WeekDay
    remain unchanged.  If you want  Date.WeekDay  set,  use the procedure
    DayOfWeek.

    If Code  >  0  then  Date  has  remained  unchanged  and  the  string
    was not in the correct form.

    Note that the year  value  must  lie  in  the  range  1991 to 1999 or
    Code is set to 6.

    Example Date Formats

    dts_DDMMYYYY

    01/01/1991      {Okay}
    00/01/1991      {Error: Invalid Day}
    12/13/1991      {Error: Invalid Month}
    12 01 1991      {Error: Needs /'s, not spaces}

    dts_DDMMMYYYY

    01 Jan 1991     {Okay}
    21 FEB 1992     {Okay}
    29 feb 1991     {Error: Not a Leap Year}
    01 01 1991      {Error: Not a Month Abbreviation}
    1/Jan/1991      {Error: Needs spaces, not /'s}

See Also: Procedure DateToString Procedure DayOfWeek
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson